var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var EventManager = require("AA_EventManager");
var ResKeeper = require("AA_ResKeeper");
var EvenType = require("AA_EvenType");
var GameGlobalVariable = require("AA_GameGlobalVariable");
var BuffMag = require("AA_BuffMag");
var UI_MosterLogic = require("AA_UI_MosterLogic");
var UI_BulletBomb = require("AA_UI_BulletBomb");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
_decorator.property;

var _def_UI_BulletBombCollider = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.offtime = 0;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.onCollisionEnter = function (e, t) {
    if (new Date().getTime() - this.offtime >= 100) {
      GameGlobalVariable.GameGlobalVariable.playHitBomb1();
      this.offtime = new Date().getTime();
      var o = t.node.parent.getComponent(UI_BulletBomb.default);
      o.getNowMosterNode().forEach(function (e) {
        var t = e.getComponent(UI_MosterLogic.default);
        BuffMag.BuffMgr.mosterBeHit(t, o.attackfang);
        t.beAttack(o);
        var n = BuffMag.BuffMgr.getLanGuaErwai(o.attackfang);
        if (n) {
          var i = t.xueliang * (n.value[0] / 100);
          t.fujiaAttack(i, 5, o);
        }
      });
      var n = e.node.getComponent(UI_MosterLogic.default);
      BuffMag.BuffMgr.addMosterBombCount(n);
      o.hideBullet();
      EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_Add_BaoZha, o.node.getPosition(), 1, o.getBombFanWei());
    }
  };
  _creator.prototype.onMyCollisionEntyer = function (e) {
    if (new Date().getTime() - this.offtime >= 100) {
      GameGlobalVariable.GameGlobalVariable.playHitBomb1();
      this.offtime = new Date().getTime();
      var t = this.node.parent.getComponent(UI_BulletBomb.default);
      t.getNowMosterNode().forEach(function (e) {
        var o = e.getComponent(UI_MosterLogic.default);
        BuffMag.BuffMgr.mosterBeHit(o, t.attackfang);
        o.beAttack(t);
        t.isbisha = false;
        var n = BuffMag.BuffMgr.getLanGuaErwai(t.attackfang);
        if (n) {
          var i = o.xueliang * (n.value[0] / 100);
          o.fujiaAttack(i, 5, t);
        }
      });
      var o = e.getComponent(UI_MosterLogic.default);
      BuffMag.BuffMgr.addMosterBombCount(o);
      t.hideBullet();
      EventManager.EventMgr.dispatchEvent(EvenType.EVENT_TYPE.Game_Add_BaoZha, t.node.getPosition(), 1, t.getBombFanWei());
    }
  };
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_BulletBombCollider;